class Decorator():
    def __init__(self, func):
        self.func = func

    def __call__(self, *args, **kwargs):
        print('begin')
        result = self.func(*args, **kwargs)
        print('after')
        return result

@Decorator
def test():
    print('test')

test()
